﻿using il.lua;

public class NewArrExpression : Expression
{
    private readonly Expression? _size;
    private readonly TypeReference _type;
    public Expression Size => _size;
    public TypeReference Type => _type;

    public NewArrExpression(TypeReference type, Expression? size)
    {
        _size = size;
        _type = type;
    }

    public override void Print()
    {
        ConsoleEx.Code("{");
        // for (var i = 0; i < _size; i++)
        // {
        //     if (i > 0)
        //         Code(", ");
        //     Code("nil");
        // }
        ConsoleEx.Code("}");
    }
}